unit AlterarEntregador;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Buttons;

type
  TFormAltEntregador = class(TForm)
    Label1: TLabel;
    Edit1: TEdit;
    BitBtn1: TBitBtn;
    BitBtn2: TBitBtn;
    procedure BitBtn1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FormAltEntregador: TFormAltEntregador;

implementation

uses Principal, Entregador;

{$R *.dfm}

procedure TFormAltEntregador.BitBtn1Click(Sender: TObject);
var sql:string;
begin

    sql := 'update entregador set nm = '''+Edit1.Text + ''' where id = ' + FormEntregador.QueryEntregador.FieldByName('id').AsString;
    FormPrincipal.QueryAtualiza.SQL.Clear;
    FormPrincipal.QueryAtualiza.SQL.Add(sql);
    FormPrincipal.QueryAtualiza.Close;
    FormPrincipal.QueryAtualiza.ExecSQL;

    //MessageDlg('Entregador Alterado',mtinformation, [mbOk], 0);
    
end;

end.
